This invention relates to machine vision and automated inspection systems, and more particularly to inspection of stencils used in solder paste screen printing of circuit boards.
The process of assembling printed circuit boards (PCBs) generally requires solder paste to be applied to the printed circuit board. This application occurs before components, such as integrated circuits and discrete devices, are placed and ultimately secured onto the board. Initially, the sticky solder paste temporarily holds the components in place on the PCB until the solder paste is melted or reflowed. When the solder paste is reflowed, it forms both mechanical and direct electrical connections between the components and the board. It is important that the appropriate quantity and area of solder paste be applied to the board for reliable connections to occur.
In a normal PCB manufacturing process, a stencil is typically placed against the top face of the board in a desired orientation in which the stencil is aligned with preformed metallic contact pads on the PCB. Solder, in paste form, is applied to the stencil so that it flows through precut holes, or apertures, in the stencil onto the contact pads. The solder becomes adhered to the contact pads as the stencil is lifted away. The solder application process often uses a squeegee-like device both to flow solder through the apertures and to remove excess solder from the stencil surface. However, due to the relative thickness of the inner perimeter edges of the apertures, some solder may become trapped against the edges. Hence, the squeegee may not effectively remove all solder from within the used stencil apertures. To maintain the accuracy and reliability of the paste application process, the stencil must remain clean. In other words, the apertures that make up the stencil, and through which the solder paste passes, should remain relatively free of blockage. While blockage of a certain level is generally permissible, aperture blockage beyond a threshold should be addressed as soon as possible by cleaning the stencil. Otherwise, PCBs will not receive the proper configuration of solder paste.
Automatic inspection or vision systems have been used to scan both the finished PCB and the stencil for manufacturing the PCB. One such inspection system is detailed in FIG. 1. The PCB 20 is located on an underlying support 22. Lighting 24 and 26, typically in the form of a series of high intensity LEDs is provided at various locations around the support 22. The stencil 30 is positioned so that it can pass over the PCB. Solder, not shown, is flowed into the apertures 32 and 34 for placement as respective solder pads 36 and 38 on the PCB 20. A vision system 40 is arranged to view the PCB 20 and/or the stencil 30. The vision system 40 can comprise any acceptable image acquisition system. It typically consists of an optics section 42 for focusing viewed images and one or more cameras 44 typically including a solid-state CCD element. The electronic image generated by the CCD is transmitted over a data line 46 to a data processor 48 that can comprise microprocessor elements and digital signal processing components. A memory 50 is used to store image data as well as processing instructions. Various input/output (I/O) devices 52 including display screens, keyboards, and the like are interconnected with the vision system processor. These provide the operator with information about the ongoing inspection process and enable the operator to input instructions and inspection parameters.
The ongoing inspection of stencils and PCBs during xe2x80x9cruntimexe2x80x9d involves complex procedures. In the past, various techniques have been employed to measure stencil blockage. One category of techniques examine only the image of the stencil after printing (the xe2x80x9cpostxe2x80x9d image), and they typically attempt to establish a binary graylevel/grayscale threshold to classify pixels as either aperture or non-aperture, i.e. all pixels darker than a certain grayscale value are considered aperture. Such xe2x80x9cpost-onlyxe2x80x9d techniques suffer from a number of deficiencies. They typically need to make fairly simple assumptions about the appearance of paste, and they are very susceptible to incorrectly interpreting changes in lighting as changes in blockage, since pixels having measured intensities near the threshold will migrate above or below the threshold as lighting changes. Similarly, different types of paste may have different appearances, creating further difficulty for a post-only technique.
Accordingly, it is an object of this invention to use an image of the clean stencil (the xe2x80x9cprexe2x80x9d image) as well as the post image in order to make measurements that are both more accurate and more robust, by using the pre image to model what clean apertures look like under lighting similar to (ideally, identical to) the lighting used to acquire the post image. An additional object is to use local variation of pixel values to help discriminate between aperture pixels and paste pixels, since under many types of lighting solder paste appears highly textured, unlike aperture, which is always relatively locally uniform. Thus, the current invention should discriminate between paste and aperture even if some dark paste pixels have the same value as some bright aperture pixelsxe2x80x94as a grayscale-only technique cannot make such a discrimination.
This invention overcomes the disadvantages of the prior art by providing a system and method for ascertaining blockage of stencil apertures (typically on PCB manufacturing stencils) that more accurately and robustly delineates actual solder blockage from the unblocked portion of the stencil aperture using the viewed grayscale intensity of aperture pixels before and after use, and also the variance or difference in grayscale intensity between directly adjacent or nearby, nonadjacent pixels. Use of such a xe2x80x9cpre-postxe2x80x9d technique allows measurements to be made even if the lighting changes somewhat, and the technique""s emphasis on modelling the clean aperture enables it to deal with a variety of different types of solder paste.
According to a preferred embodiment, an analysis of pixels in an image of one or more apertures is made that includes determining the relative grayscale intensity of pixels acquired from the clean stencil and also the variance between directly adjacent and/or nearby (not directly adjacent) pixels. The grayscale and variance values for each pixel are combined to form a series of histogram groupings or bins, based upon grayscale levels. These values are used to compute parameters that model how the apertures appear under the lighting conditions used to acquire the image, thus allowing the creation of a decision function that estimates the probability that a given pixel represents unblocked aperture rather than solder paste.
Image data for each aperture are used to calibrate the lighting level of each window""s pixel data on the clean stencil. The area of each clean stencil aperture is also determined using the weighted pixel measurements. Pixels having high variance or non-aperture grayscale intensities are, in essence, discarded from the area determination. During runtime, the aperture is measured and the intensity and variance are ascertained for each pixel. The measured area is again ascertained, and the difference between clean and used aperture area is calculated and reported. If the difference is significant, then the operator is notified that stencil cleaning is required.
In a preferred embodiment, the stencil is registered to model data to locate a group of apertures. The image is then divided into separate windows, each containing an aperture that can be analyzed separately after lighting calibration; the use of separate windows allows small lighting variations among apertures to be factored out. Lighting recalibration can be performed on an on-going basis to adjust for overall changes in lighting.